package com.jhws.business.local.api;

import com.jhws.business.local.service.LocalService;
import com.jhws.common.base.bo.JsonRespData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@Controller
@RequestMapping("/unlock")
public class UnlockApi {

    @Resource
    private LocalService localService;

    @RequestMapping("saveUnlockImage")
    @ResponseBody
    public JsonRespData uploadVideoAds(@RequestParam("image") MultipartFile image,
                                       String fileName) throws Exception {
        String url = localService.saveUnlockImage(image, fileName);
        return new JsonRespData("", 1, url);
    }
}
